import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.concurrent.TimeUnit;

import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBFactory;
import org.influxdb.dto.Point;
import org.influxdb.dto.Point.Builder;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

public class SimulatorTAWorker extends TAWorker {
	

	@Override
	public void run() {

		String dbName =this.getDbName();
		String dburl = this.getDburl();
		InfluxDB influxDB = InfluxDBFactory.connect(dburl, "root", "Pa55word");
		influxDB.enableBatch(2000, 500, TimeUnit.MILLISECONDS);
		influxDB.createDatabase(dbName);
        while (true)
        {
     		System.out.println("This function called "+Thread.currentThread().getId());  
     		try {
				Thread.currentThread().sleep(5000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
        }
	}
		
	

}
